* {
	box-sizing: border-box;
	margin: 0;
}

:root {
	--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif,
		'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
	--font-family-code: Menlo, Monaco, Consolas, 'Droid Sans Mono', monospace, 'Droid Sans Fallback';
	--font-size: 15px;
	--line-height: 1.6;
	--rule: #bbaea8c4;
	--background: #d3c7c0;
	--foreground: #2f2c30;
	--link: #0064c8;
	--pre-code: #d1d0cc;
	--inline-code: #865c00;
	--code-number: #5ed4ff;
	--code-string: #b4ee64d4;
	--code-literal: #c36ff0;
	--code-special: #6ee6d2;
	--code-comment: #84858a;
	--pre-background: #262128;
	--result-header: #5e6371;
	--result-background: #cbc4c4;
	--result-shadow: #503a1540;
	--toc-width: 210px;
	--toc-button-size: 40px;
	--toc-button-margin: 1rem;
	--toc-button-border: #0003;
	--border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--rule: #43444c;
		--background: #27282c;
		--foreground: #cdcac7;
		--pre-background: #1f1d22;
		--link: #5ed4ff;
		--inline-code: #e1bd70;
		--result-header: #434f5b;
		--result-background: #7b8087;
		--result-shadow: #00000040;
		--toc-button-border: #0007;
	}
}

html,
body {
	font-family: var(--font-family);
	line-height: var(--line-height);
	font-size: var(--font-size);
	padding: 0;
}

html {
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	background-color: var(--background);
	color: var(--foreground);
}

/* basic markdown */

strong {
	font-weight: 600;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

pre {
	color: var(--pre-code);
	background: var(--pre-background);
	padding: 1rem;
	overflow: auto;
	font-family: var(--font-family-code);
	border-radius: var(--border-radius);
	tab-size: 4;
}

code {
	font-family: var(--font-family-code);
	font-size: 1em;
	line-height: 1.357em;
	color: var(--inline-code);
}

pre code {
	color: var(--pre-code);
}

p code,
li code {
	white-space: nowrap;
	font-size: 0.95em;
}

hr {
	height: 2px;
	border: 0;
	background: var(--rule);
}

/* headers */

h1 {
	font-size: 2.35em;
	line-height: 1;
	font-weight: 700;

	border-top: 2px solid var(--rule);
	padding-top: 2rem;
	margin-bottom: 1.75rem;
}

section:first-of-type h1 {
	border: none;
}

h2 {
	font-size: 1.5em;
	line-height: 1.35;
	font-weight: 500;

	border-top: 1px solid var(--rule);
	padding-top: 1.25rem;
	margin-bottom: 1.25rem;
}

h3 {
	font-size: 1em;
	line-height: var(--line-height);
	font-weight: 600;

	border-top: 1px solid var(--rule);
	padding-top: 1.35rem;
	margin-bottom: 1rem;
}

h1 a,
h2 a,
h3 a {
	color: var(--foreground);
}

/* hide header border when scrolling to anchor */

a[name]:empty {
	position: absolute;
	margin-top: 3px;
}

/* vertical spacing */

p,
ul {
	margin-bottom: calc(var(--line-height) * 1rem);
}

ul {
	padding-left: 1.25rem;
}

pre,
.result {
	margin-bottom: calc(var(--line-height) * 1.25rem);
}

p + p,
p + ul,
ul + p,
pre + p,
pre + ul,
pre + .result,
.result + p {
	margin-top: calc(var(--line-height) * -0.25rem);
}

/* code highlighting */

.hljs-keyword,
.hljs-selector-tag,
.hljs-section,
.hljs-doctag,
.hljs-strong {
	font-weight: bold;
}

.hljs-comment {
	color: var(--code-comment);
}

.hljs-section,
.hljs-type,
.hljs-addition,
.hljs-tag,
.hljs-quote,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-built_in {
	color: var(--code-special);
}

.hljs-literal {
	color: var(--code-literal);
}

.hljs-number {
	color: var(--code-number);
}

.hljs-string {
	color: var(--code-string);
}

/* main */

#container {
	display: flex;
}

main {
	max-width: 700px;
	box-sizing: content-box;
	padding: 0 2rem;
}

/* toc */

#toc-container {
	width: var(--toc-width);
	position: relative;
}

#toc {
	position: fixed;
	overflow: auto;
	width: var(--toc-width);
	height: 100%;
	padding: 0 1rem;
	top: 0;
	background: var(--background);
	border-right: 1px solid var(--rule);
	z-index: 1002;
	font-size: 12px;
	line-height: 21px;
}

#toc h1,
#toc h2,
#toc h3 {
	border: none;
	padding-top: 0;
	margin-bottom: 1rem;
}

#toc h1 {
	font-size: 14px;
	font-weight: 600;
	/* spacing lives in h1 so it has 
     * padding when scrolled into view */
	margin-top: 0;
	padding-top: 1rem;
}

#toc h2 {
	font-size: 14px;
	font-weight: 600;
}

#toc h3 {
	font-size: 12px;
	font-weight: 400;
	font-style: italic;
}

#toc ol,
#toc ul {
	margin-bottom: 1rem;
	padding-left: 1rem;
}

#toc a {
	color: var(--foreground);
}

/* active section highlight */
#toc h2.active a,
#toc li.active,
#toc li.active a {
	color: var(--link);
}

/* toc button */

#toc-button {
	position: fixed;
	visibility: hidden;
	outline: none;
	cursor: pointer;
	appearance: none;
	z-index: 1;
	width: var(--toc-button-size);
	height: var(--toc-button-size);
	top: var(--toc-button-margin);
	right: var(--toc-button-margin);
	border-radius: var(--border-radius);
	background: var(--background);
	border: 1px solid var(--toc-button-border);
	border-bottom-width: 2px;
	font-size: 0;
	display: flex;
	padding: 10px;
	box-sizing: border-box;
	flex-wrap: wrap;
	align-items: center;
}

#toc-button:before,
#toc-button:after {
	content: ' ';
	display: block;
}

#toc-button:before,
#toc-button:after,
#toc-button div {
	width: 100%;
	height: 3px;
	border-radius: 3px;
	background: var(--foreground);
}

/* examples */

#section-examples {
	margin: 2rem 0 2.5rem;
}

#section-examples li:not(:last-child) {
	margin-bottom: 0.25rem;
}

/* guide */

#section-guide code span.changed {
	background-color: magenta;
	transition: none;
}

#section-guide code span {
	background-color: transparent;
	transition: background-color 0.5s linear;
}

/* guide demos */

.result {
	--header-size: 26px;
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
	padding: 0 16px 16px 0;
	border-top: var(--header-size) solid var(--result-header);
	border-radius: 5px;
	background: var(--result-background);
	min-height: 150px;
	position: relative;
	box-shadow: 0 5px 30px var(--result-shadow);
}

.result::before {
	content: 'Result';
	color: var(--pre-code);
	position: absolute;
	left: 8px;
	font-size: 11px;
	font-weight: 600;
	top: calc(-1 * var(--header-size));
	height: var(--header-size);
	display: flex;
	align-items: center;
}

/* api */

main .api-index {
	columns: 2;
	column-rule: 1px solid var(--rule);
	column-gap: 60px;
	margin-bottom: 2rem;
}

main .api-index .class {
	width: 100%;
	break-inside: avoid;
}

main .api-index a {
	color: var(--foreground);
}

main .api-index ul {
	margin: 0;
}

/* member declarations vary weight */
.api-index h2,
#section-api h2 {
	font-weight: normal;
}

.api-index h2 {
	border: none;
	padding: 0;
}

#section-api li p {
	margin-bottom: 1rem;
}

#section-api li:last-child p {
	margin: 0;
}

/* autoPlace demo */

.autoPlace {
	will-change: opacity;
	transition: none;
}

.loaded .autoPlace {
	transition: opacity 0.2s;
}

.scrolled .autoPlace {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 1200px) {

	.autoPlace {
		opacity: 0;
		pointer-events: none;
	}

}

/* small desktop */

@media (max-width: 958px) {
	main {
		margin: 0 auto;
		padding: 0 1rem;
	}

	#container {
		display: block;
	}

	#toc-button {
		visibility: visible;
	}

	#toc {
		border: 0;
		right: 0;
		transition: transform cubic-bezier(0.215, 0.610, 0.355, 1) 0.5s;
	}

	.toc-open #toc {
		box-shadow: 23px 0 10px 20px #0007;
	}

	body:not(.toc-open) #toc {
		transform: translateX(var(--toc-width));
	}
}

/* mobile */

@media (max-width: 500px) {
	pre {
		font-size: 13.5px;
		tab-size: 2;
	}

	.result {
		min-height: 0;
	}

	ul {
		padding-left: 1.5rem;
	}

	main .api-index {
		column-rule: none;
		column-gap: 0;
		font-size: 0.95rem;
	}

	main .api-index ul {
		padding-left: 0;
		list-style: none;
	}

}
